using System;
using System.Collections.Generic;
using System.Text;

namespace SharpMud.Text.Dynamic.Processing
{
    /// <summary>
    /// Represents a processed Dynamic Text Body that is ready to be converted into a CodeCompileUnit
    /// and compiled with other processed Dynamic Text Body's, or even other accompanying code.
    /// </summary>
    /// <remarks>
    /// This internalizes all the work involved in actually taking the parsed data and putting it in a state
    /// where it is ready to be compiled.
    /// </remarks>
    public interface IProcessedDynamicTextBody
    {
        /// <summary>
        /// Gets the CodeTypeDeclaration that encompasses the class name, implemented/inherited types for the generated class,
        /// the method definition (and code) for the dynamic text (including a designation as to which method the dynamic text
        /// implements/overrides).
        /// </summary>
        System.CodeDom.CodeTypeDeclaration CodeTypeDeclaration { get;}

        /// <summary>
        /// Gets the CodeNamespaceImport's that either the dynamic text explicitly requests or that
        /// the dynamic text implicitly uses based on its processing parameters.
        /// </summary>
        /// <remarks>It is quite possible for this property to return an empty array.</remarks>
        System.CodeDom.CodeNamespaceImport[] CodeNamespaceImports { get;}

        /// <summary>
        /// Gets the full name of the namespace that the compiled type is to be declared in
        /// </summary>
        string Namespace { get;}

        /// <summary>
        /// Gets the CodeDomProvider that is specific to the language that the dynamic
        /// text was written in.
        /// </summary>
        /// <remarks>This property may return null, in case there is no specific code language. That is,
        /// if the dynamic text body was completely computer generated, (such as if it is actually completely static).</remarks>
        System.CodeDom.Compiler.CodeDomProvider CodeDomProvider { get;}

        /// <summary>
        /// Gets the hash of the source code
        /// </summary>
        System.HashWrapper SourceHash { get;}

        /// <summary>
        /// Converts all of the code data that the IProcessedDynamicTextBody represents into a language-bound CodeCompileUnit
        /// </summary>
        /// <returns></returns>
        LanguageBoundCode<System.CodeDom.CodeCompileUnit> ToCodeCompileUnit();
    }
}
